/* 
 * 						IMPORTANT!!!!
 *		 -------------------------------------------
 *		| Design a  RAM light database program		|
 * 		| Even if it takes all bloody week!!		|
 * 		 -------------------------------------------
 * 
 * 	Look up templates
*/
#include <iostream>

using namespace std;

int intWordPlace = 0;

class word /* Nouns, Adjectives etc all inherit from this */
{
	public:
		string name,gender,age;
};

void recognition(string strMainWord,string strType)
{
	cout << "Recognised the word \"" << strMainWord << "\" on line " << intWordPlace << " of " << strType << ".\n";
}

void databaselookup(string* strWordArray, int i,string strFileName)
{
	word woMainWord;
	string strBuffer = " ";
	strFileName += "s.bot";
	ifstream database(strFileName.c_str());
	while(! database.eof())
	{
		if (woMainWord.name != strWordArray[i])
		{
			getline(database,woMainWord.name,'|');
			getline(database,strBuffer);
			intWordPlace++;
		}
		else
		{
			getline(database,strBuffer);
		}
	}
	database.close();
	if (woMainWord.name == strWordArray[i])
	{
		recognition(strWordArray[i],strFileName);
	}
	intWordPlace = 0;
}
namespace prc
{
	void processfunc(string* strWordArray,int intWordNum)
	{
		for (int i=0;i<intWordNum;i++)
		{
			databaselookup(strWordArray,i,"noun");
			databaselookup(strWordArray,i,"adverb");
			databaselookup(strWordArray,i,"adjective");
			/* Check to see if strWordArray[i] is in database
			 * if it is, then,
			 * <debug>display everything related to it</debug>
			 * else, check it Do some recursive checks against each
			 * word before it, if that doesnt work, store that word 
			 * in unrecognisedmemory, if it does, look to see if the word 
			 * before it is in unrecongnisedmemory, and delete it + Check
			 * that word against the database, if it doesnt, add it to 
			 * unrecognised memory. This should (with the proper syntax 
			 * and context processing), ensure that even if you type 
			 * (accidently), "Hel lo" then it should recognise that word 
			 * as "Hello". Context checking would really be needed to make
			 * sure that "for gery" would not be read as "for" and "unkown"
			 * Refer to diagram if this blows the shit out of your mind.
			*/
		}
	}
}
